﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twodi.Aspect.Interfaces;
using Twodi.Interfaces;
using System.ComponentModel;

namespace Twodi.Aspect.Implemented
{
    public class ContainerAspect<T> : AbstractAspect, IContainer<T>
    {
        /// <summary>
        /// Construtor padrão.
        /// </summary>
        public ContainerAspect()
        {
            Components = new BindingList<T>();
        }

        /// <summary>
        /// Componentes do container.
        /// </summary>
        public BindingList<T> Components { get; private set; }

        /// <summary>
        /// Adicionar multiplos componentes ao container.
        /// </summary>
        /// <param name="components">Componentes a serem adicionados ordenadamente.</param>
        public void Add(params T[] components)
        {
            for (int i = 0; i < components.Length; i++)
            {
                this.Components.Add(components[i]);
            }
        }
    }
}
